const split_Symbol_H = /<br\/>/

module.exports.TABLE_TYPE = [
  {
    count: 'A',
    title: '日期',
    rule: (str) => {
      const date = new Date()
      const dateStr = `${date.getFullYear()}.${date.getMonth() + 1}.${ date.getDate()}`
      return str || dateStr
    }
  },
  {
    count: 'B',
    title: 'IT云',
    rule: (str) => {
      return str ? deleteContextRowByNum(str.split(split_Symbol_H), 1) : ''
    }
  },
  {
    count: 'C',
    title: '移动云/云上贵州',
    rule: (str) => {
      return str ? deleteContextRowByNum(str.split(split_Symbol_H), 2) : ''
    }
  },
  {
    count: 'D',
    title: 'IDC',
    rule: (str) => {
      return str ? deleteContextRowByNum(str.split(split_Symbol_H), 1) : ''
    }
  },
  {
    count: 'E',
    title: '动环',
    rule: (str) => {
      return str ? str :  ''
    }
  },
  {
    count: 'F',
    title: 'IDC网络',
    rule: (str) => {
      return str ? deleteContextRowByNum(str.split(split_Symbol_H), 1) : ''
    }
  },
  {
    count: 'G',
    title: '网管网',
    rule: (str) => {
      return str ? deleteContextRowByNum(str.split(split_Symbol_H), 1) : ''
    }
  },
  {
    count: 'H',
    title: '网关支撑及边缘云',
    rule: (str) => {
      return str ? deleteContextRowByNum(str.split(split_Symbol_H), 1) : ''
    }
  },
  {
    count: 'I',
    title: '政企云',
    rule: (str = '') => {
      return str ? deleteContextRowByNum(str.split(split_Symbol_H), 1) : ''
    }
  }
]

const deleteContextRowByNum = (str = '', number = 0) => {
  return str.slice(number).join()

}
